package com.htl.集合;

import java.util.LinkedList;

public class LinkedList__test {
    public static void main(String[] args) {
        LinkedList linkedList = new LinkedList();
        linkedList.add("Hello");
        linkedList.add("World");
        linkedList.add(1,"OK");
        System.out.println(linkedList);
        System.out.println("------------------------------------------");
        linkedList.addFirst("TEST");
        linkedList.addLast("Success");
        System.out.println(linkedList);
        System.out.println("==========================================");
        System.out.println(linkedList.peekFirst());
        System.out.println(linkedList.peekLast());
        System.out.println(linkedList.peek());
        System.out.println(linkedList.poll());
        System.out.println(linkedList.pollFirst());
        System.out.println(linkedList.pollLast());
    }
}
